if (typeof(QS_PROTOCOL) == 'undefined') {
	QS_PROTOCOL = 'http://';
}

//quick take data
var QS_BASEPATH = QS_PROTOCOL + document.location.host+'/';
if(typeof(QS_VERSION)!= 'undefined' && QS_VERSION == 'dev'){
	if(window.location.pathname.indexOf('opt')!=-1){
		QS_BASEPATH += 'opt/'
	}else{
		QS_BASEPATH += 'stage/'
	}
}

if(typeof(QS_VERSION)!= 'undefined' && QS_VERSION == 'staging'){
	if(window.location.pathname.indexOf('prestage')!=-1){
		QS_BASEPATH += 'prestage/'
	}
}
var getQtPageUrl = QS_BASEPATH + 'getQtPage.jsp?pagename=';

var QS_QTabs = {};
var QS_QT_TabMapping = {};
var QS_QT_TabSequence = {
	'ST':[3.44,3.11,3.12,3.13,3.14,3.15,3.16,3.17,3.18,3.19,3.21,3.22,3.37,3.48],
	'PR':[3.44,3.11,3.13,3.15,3.16,3.17,3.19,3.21,3.22,3.48],//Preferred Stock
	'FE':[3.45,3.26,3.12,3.23,3.27,3.15,3.24,3.25,3.28],
	'FC':[3.46,3.32,3.24,3.15,3.27,3.29,3.31,3.34,3.35,3.36],
	'FO':[3.47,3.33,3.23,3.25,3.24,3.21,3.27],
	'FM':[3.38,3.39,3.41,3.42,3.43]
};

//3.11,3.12,3.13,3.14,3.15,3.16,3.17,3.18,3.19,3.21,3.22,3.37
//3.1211,3.1212,3.1213,   3.1311,3.1312,3.1313,3.1314,  
//3.1411,3.1412,  3.1511,3.1512,3.1513,3.1514,3.1515,    
//3.1611,3.1612,3.1613,3.1614,3.1615,3.1616,   3.2111,3.2112,3.2113
(function(){//Stock
	$.extend(QS_QTabs, {
		// Stock start ================================================================================================================
		'Stock Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_PROTOCOL + 'quote.morningstar.com/stock/stockquote.aspx?ops=clear&cur=usd&ProductCode=QS&culture=en-US',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
				
		'Profile': {
			txt: QS_Lang.quicktake["profile"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/company-profile/c.action?ops=p&productcode=qs&culture=en-US',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'Analysis': {
			txt: QS_Lang.quicktake["analysis"],
			val: '',
			url: QS_BASEPATH + 'qt_analysis.htm?',
			par: [{
				't': 'TICKER'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_analysis.png'
		},
		'Current': {
			txt: QS_Lang.quicktake["curr"],
			val: '',
			url: QS_BASEPATH + 'qt_analysis.htm?',
			par: [{
				't': 'TICKER'
			}]
		},
		'Archive': {
			txt: QS_Lang.quicktake["arch"],
			val: '',
			url: QS_BASEPATH + 'analystArc.htm?',
			par: [{
				't': 'TICKER'
			}]
		},
		'Sector': {
			txt: QS_Lang.quicktake["sector"],
			val: '',
			url: QS_BASEPATH + 'analystTopStocks.htm?',
			par: [{
				't': 'TICKER'
			}]
		},
		
		'Financials': {
			txt: QS_Lang.quicktake["fin"],
			val: '',
			url: QS_BASEPATH + 'qt_financial_quote.htm?reportType=fq',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_financials.png'
		},
		'Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_BASEPATH + 'qt_financial_quote.htm?reportType=fq',
			//url:QS_PROTOCOL + '',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}]
		},
		'Inc Statement': {
			txt: QS_Lang.quicktake["state"],
			val: '',
			//url: QS_BASEPATH + 'qt_fundamentalx.htm?reportType=is',
			url: QS_PROTOCOL + 'financials.morningstar.com/income-statement/is.html?ulture=en-US&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Balance Sheet': {
			txt: QS_Lang.quicktake["sheet"],
			val: '',
			//url: QS_BASEPATH + 'qt_fundamentalx.htm?reportType=bs',
			url: QS_PROTOCOL + 'financials.morningstar.com/balance-sheet/bs.html?culture=en-us&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Cash Flow': {
			txt: QS_Lang.quicktake["cash"],
			val: '',
			//url: QS_BASEPATH + 'qt_fundamentalx.htm?reportType=cf',
			url: QS_PROTOCOL + 'financials.morningstar.com/cash-flow/cf.html?culture=en-us&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Valuation': {
			txt:  QS_Lang.quicktake["qt_value"],
			val: '',
			//url: QS_BASEPATH + 'qt_valuation.htm?page=val&culture=en-US&ops=p',
			url: QS_PROTOCOL + 'financials.morningstar.com/valuation/direct/price-ratio.html?culture=en-US&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_valuation.png'
		},
		'WS Est': {
			txt: QS_Lang.quicktake["wallstreet"],
			val: '',
			//        url: QS_BASEPATH + 'qt_valuation_wallstreet.htm?page=wse&culture=en-US&ops=p',
			url: QS_PROTOCOL + 'financials.morningstar.com/valuation/direct/earnings-estimates.html?culture=en-us&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'Shareholders': {
			txt: QS_Lang.quicktake["holders"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-overview.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_shareholders.png'
		},
		'Shareholders Overview': {
			txt: QS_Lang.quicktake["over"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-overview.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Major': {
			txt: QS_Lang.quicktake["major"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-major.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Concentrated': {
			txt:  QS_Lang.quicktake["concentrate"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-concentrated.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Buying': {
			txt: QS_Lang.quicktake["buy"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-buying.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Selling': {
			txt: QS_Lang.quicktake["sell"],
			val: '',
			url: QS_PROTOCOL + 'investors.morningstar.com/ownership/shareholders-selling.html?ops=clear&culture=en_US&nav=no&ProductCode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'Insiders': {
			txt: QS_Lang.quicktake["insider"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/insider-summary.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_insider.png'
		},
		'Insiders Overview': {
			txt:  QS_Lang.quicktake["over"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/insider-summary.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Exec Comp': {
			txt: QS_Lang.quicktake["exec"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/executive-compensation.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Activity': {
			txt: QS_Lang.quicktake["activity"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/insider-activity.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Key Exec': {
			txt: QS_Lang.quicktake["kexec"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/key-executives.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Board': {
			txt: QS_Lang.quicktake["board"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/board-of-directors.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Committees': {
			txt: QS_Lang.quicktake["commit"],
			val: '',
			url: QS_PROTOCOL + 'insiders.morningstar.com/trading/insider-committees.action?ProductCode=QS&culture=en_US&ops=p',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'Filings': {
			txt:  QS_Lang.quicktake["filings"],
			val: '',
			url: getQtPageUrl + '17&path=' + QS_PROTOCOL + 'globaldocuments.morningstar.com/documentlibrary/companydoc.aspx?clientid=msqs&key=1f6575bb0bbe37e8',
			par: [{
				't': 'TICKER'
			}, {
				'companyid': 'companyId'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_filings.png'
		},
		
		'Bonds': {
			txt: QS_Lang.quicktake["bond"],
			val: '',
			url: getQtPageUrl + '18&path=' + QS_PROTOCOL + 'bond.morningstar.com/internal/company.aspx?clientId=QS',
			par: [{
				'Cid': 'companyId'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_bonds.png'
		},
		
		'Key Ratios': {
			txt: QS_Lang.quicktake["krate"],
			val: '',
			//url: QS_BASEPATH + 'qt_keyratio.htm?',
			//url: http://financials.morningstar.com/direct/ratios/r.html?t=MSFT&region=usa&culture=en_us&cur=usd&productCode=QS //direct version
			url: QS_PROTOCOL + 'financials.morningstar.com/ratios/r.html?culture=en-us&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_keyratios.png'
		},
		
		'Performance': {
			txt: QS_Lang.quicktake["perf"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?ops=clear&nav=no&productcode=qs&culture=en-us',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_performance.png'
		},
		
		'Coupon Info':{
			txt: QS_Lang.quicktake["coupon"],
			val: '',
			url: QS_BASEPATH + 'qt_couponInfo.html?productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_performance.png'
		},
		
		'Total Returns': {
			txt:  QS_Lang.quicktake["total"],
			val: '',
			//url: getQtPageUrl + '21&path=' + QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?ops=clear&nav=no',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?culture=en-us&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Price History': {
			txt: QS_Lang.quicktake["phist"],
			val: '',
			//url: getQtPageUrl + '21&path=' + QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?ops=clear&nav=no&p=price_history_page',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=price_history_page&culture=en-US&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Dividends & Splits': {
			txt: QS_Lang.quicktake["d&s"],
			val: '',
			//url: getQtPageUrl + '21&path=' + QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?ops=clear&nav=no&p=dividend_split_page',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=dividend_split_page&culture=en-US&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'Industry Peers': {
			txt: QS_Lang.quicktake["peers"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/competitors/industry-peer.action?productcode=qs',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_industrypeers.png'
		},
		
		'Transcript': {
			txt: QS_Lang.quicktake["trans"],
			val: '',
			url: QS_PROTOCOL + 'www.morningstar.com/earnings/transcript-clear.aspx?culture=en-US&productcode=QS',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		
		'CorporateActions': {
			txt: QS_Lang.quicktake["corp"],
			val: '',
//			url: QS_PROTOCOL + 'www.morningstar.com/earnings/transcript-clear.aspx?culture=en-US&productcode=QS',
//			par: [{
//				't': 'ticker'
//			}, {
//				'region': 'country'
//			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_corpaction.png'
		},
		
		'CorporateActions Dividends': {
			txt: QS_Lang.quicktake["divid"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=dividend_split_page&culture=en-US&productcode=qs&ops=clear&subPage=1&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'CorporateActions Splits': {
			txt: QS_Lang.quicktake["split"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=dividend_split_page&culture=en-US&productcode=qs&ops=clear&subPage=2&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'Earnings': {
			txt: QS_Lang.quicktake["earn"],
			val: '',
			//url: QS_BASEPATH + 'qt_fundamentalx.htm?reportType=is',
			url: QS_PROTOCOL + 'financials.morningstar.com/income-statement/is.html?ulture=en-US&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		}
		// Stock end ================================================================================================================
	});
})();
(function(){
	$.extend(QS_QT_TabMapping, {
		3.44: QS_QTabs['Stock Quote'],
		3.11: QS_QTabs['Profile'],
		3.12: $.extend(QS_QTabs['Analysis'], {
			subTab: {
				3.1211: QS_QTabs['Current'],
				3.1212: QS_QTabs['Archive'],
				3.1213: QS_QTabs['Sector']
			}
		}),
		3.13: $.extend(QS_QTabs['Financials'], {
			subTab: {
				3.1311: QS_QTabs['Quote'],
				3.1312: QS_QTabs['Inc Statement'],
				3.1313: QS_QTabs['Balance Sheet'],
				3.1314: QS_QTabs['Cash Flow']
			}
		}),
		3.14: $.extend(true, QS_QTabs['Valuation'], {
			subTab: {
				3.1411: QS_QTabs['Valuation'],
				3.1412: QS_QTabs['WS Est']
			}
		}),
		3.15: $.extend(QS_QTabs['Shareholders'], {
			subTab: {
				3.1511: QS_QTabs['Shareholders Overview'],
				3.1512: QS_QTabs['Major'],
				3.1513: QS_QTabs['Concentrated'],
				3.1514: QS_QTabs['Buying'],
				3.1515: QS_QTabs['Selling']
			}
		}),
		3.16: $.extend(QS_QTabs['Insiders'], {
			subTab: {
				3.1611: QS_QTabs['Insiders Overview'],
				3.1612: QS_QTabs['Exec Comp'],
				3.1613: QS_QTabs['Activity'],
				3.1614: QS_QTabs['Key Exec'],
				3.1615: QS_QTabs['Board'],
				3.1616: QS_QTabs['Committees']
			}
		}),
		3.17: QS_QTabs['Filings'],
		3.18: QS_QTabs['Bonds'],
		3.19: QS_QTabs['Key Ratios'],
		3.21: $.extend(QS_QTabs['Performance'], {
			subTab: {
				3.2116: QS_QTabs['Coupon Info'],
				3.2113: QS_QTabs['Dividends & Splits'],
				3.2111: QS_QTabs['Total Returns'],
				3.2112: QS_QTabs['Price History']
			}
		}),
		3.22: QS_QTabs['Industry Peers'],
		3.37: QS_QTabs['Transcript'],
		3.48: $.extend(QS_QTabs['CorporateActions'], {//add CorporateActions
			subTab: {
				3.4811: QS_QTabs['CorporateActions Dividends'],
				3.4812: QS_QTabs['CorporateActions Splits'],
				3.4813: QS_QTabs['Earnings']
			}
		})
	});
})();

//3.12,3.15,3.23,3.24,3.25,3.26,3.27,3.28
//3.1214,3.1215,	 3.1511,3.1512,3.1513,3.1514,3.1515,	 3.2511,3.2512,3.2513,3.2514,3.2515,3.2516
(function(){//ETF
	$.extend(QS_QTabs, {
		// ETF start ================================================================================================================
		'ETF Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_PROTOCOL + 'etfs.morningstar.com/quote?productcode=qs',
			//url: QS_PROTOCOL + 'quote.morningstar.com/fund/fundquote.aspx?ops=clear&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'ETF/MF Operation': {
			txt: QS_Lang.quicktake["oper"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/etfund/operations.html?productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_operation.png'
		},
		
//		'Fund Operation': {
//			txt: 'Operation',
//			val: '',
//			url: getQtPageUrl + '26&path=' + QS_PROTOCOL + 'financials.morningstar.com/fund/operations.html?culture=en-US&ops=clear&nav=none',
//			par: [{
//				't': 'TICKER'
//			}, {
//				'region': 'country'
//			}],
//			value: 'qt',
//			imgPosition: '0 0',
//			imgSrc: 'bg_pre_qt_operation.png'
//		},
//		'Overview': {
//			txt: 'Overview',
//			val: '',
//			url: getQtPageUrl + '26&path=' + QS_PROTOCOL + 'financials.morningstar.com/fund/operations.html?culture=en-US&ops=clear&nav=none',
//			par: [{
//				't': 'TICKER'
//			}, {
//				'region': 'country'
//			}]
//		},
//		'Fees & Expenses': {
//			txt: 'Fees & Expenses',
//			val: '',
//			url: getQtPageUrl + '26&path=' + QS_PROTOCOL + 'financials.morningstar.com/fund/expense.html?culture=en-US&ops=clear&nav=none',
//			par: [{
//				't': 'TICKER'
//			}, {
//				'region': 'country'
//			}]
//		},
//		'Management': {
//			txt: 'Management',
//			val: '',
//			url: getQtPageUrl + '26&path=' + QS_PROTOCOL + 'financials.morningstar.com/fund/management.html?culture=en-US&ops=clear&nav=none',
//			par: [{
//				't': 'TICKER'
//			}, {
//				'region': 'country'
//			}]
//		},
//		'Purchase': {
//			txt: 'Purchase',
//			val: '',
//			url: getQtPageUrl + '26&path=' + QS_PROTOCOL + 'financials.morningstar.com/fund/purchase-info.html?culture=en-US&ops=clear&nav=none',
//			par: [{
//				't': 'TICKER'
//			}, {
//				'region': 'country'
//			}]
//		},
		
		'ETF Current': {
			txt: QS_Lang.quicktake["curr"],
			val: '',
			url: QS_BASEPATH + 'qt_analysis_etf_rs.htm?',
			par: [{
				't': 'TICKER'
			}]
		},
		'ETF Archive': {
			txt: QS_Lang.quicktake["arch"],
			val: '',
			url: QS_BASEPATH + 'qt_analysis_etf_rp.htm?',
			par: [{
				't': 'TICKER'
			}]
		},
		
		'Fund Ratings & Risk': {
			txt: QS_Lang.quicktake["r&r"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/etf/ratings-risk.action?culture=en-US&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_ratingsrisk.png'
		},
		
		'Portfolio': {
			txt: QS_Lang.quicktake["port"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=1',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_portfolio.png'
		},
		'Style/Allocation': {
			txt: QS_Lang.quicktake["s/a"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=1',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/cef?productCode=qs&module=1&aaview=UK',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Sectors/Stats': {
			txt: QS_Lang.quicktake["s/s"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=2',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/cef?productCode=qs&module=2',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'GICS Sector/Industry': {
			txt: QS_Lang.quicktake["s/i"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=3',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Holdings': {
			txt: QS_Lang.quicktake["holds"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?productCode=qs',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?productCode=qs',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}]
		},
		'Regions': {
			txt: QS_Lang.quicktake["reg"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?productCode=qs&module=2',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}]
		},
		'History': {
			txt: QS_Lang.quicktake["hist"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/history?productCode=qs',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}]
		},
		
		'Tax Analysis': {
			txt: QS_Lang.quicktake["taxa"],
			val: '',
			//url: getQtPageUrl + '24&path=' + QS_PROTOCOL + 'performance.morningstar.com/fund/tax-analysis.action?culture=en-US&ops=p',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/etf/tax-analysis.action?culture=en-US&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_taxanalysis.png'
		},
		
		//shareholders the same as stock
		
		'Performance3.28': {
			txt: QS_Lang.quicktake["perf"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/etf/total-returns.action?culture=en-US&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_performance2.png'
		},
		
		'Filings3.27': {
			txt: QS_Lang.quicktake["filings"],
			val: '',
			url: getQtPageUrl + '17&path=' + QS_PROTOCOL + 'globaldocuments.morningstar.com/documentlibrary/dochistory.aspx?clientid=msqs&key=1f6575bb0bbe37e8&investmenttype=1',
			par: [{
				'investmentId': 'secId'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_filings.png'
		}
		// ETF end ================================================================================================================
	});
})();
(function(){
	$.extend(QS_QT_TabMapping[3.12]["subTab"],{
		3.1214: QS_QTabs['ETF Current'],
		3.1215: QS_QTabs['ETF Archive']
	});
				
	$.extend(QS_QT_TabMapping, {
		//3.12
		//3.15
		3.45: QS_QTabs['ETF Quote'],
		3.26: QS_QTabs['ETF/MF Operation'],
		//	3.26: $.extend(QS_QTabs['Fund Operation'], {
		//		subTab: {
		//			3.2611: QS_QTabs['Overview'],
		//			3.2612: QS_QTabs['Fees & Expenses'],
		//			3.2613: QS_QTabs['Management'],
		//			3.2614: QS_QTabs['Purchase']
		//		}
		//	}),
		3.23: QS_QTabs['Fund Ratings & Risk'],
		3.25: $.extend(true, QS_QTabs['Portfolio'], {
			subTab: {
				3.2511: QS_QTabs['Style/Allocation'],
				3.2512: QS_QTabs['Sectors/Stats'],
				3.2513: QS_QTabs['GICS Sector/Industry'],
				3.2514: QS_QTabs['Holdings'],
				3.2515: QS_QTabs['Regions'],
				3.2516: QS_QTabs['History']
			}
		}),
		3.24: QS_QTabs['Tax Analysis'],
		3.28: QS_QTabs['Performance3.28'],
		3.27: QS_QTabs['Filings3.27']
	});
})();

//3.15,3.24,3.27,3.29,3.31,3.32,3.34,3.35,3.36
//3.1511,3.1512,3.1513,3.1514,3.1515,  3.2511,3.2512,3.2513, 3.3411,3.3412,	 3.3611,3.3612,3.3613,3.3614,3.3615 
(function(){//CEF
	$.extend(QS_QTabs, {
		//3.32 Operation
		'CEF Quote':{
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_PROTOCOL + 'cef.morningstar.com/quote?productcode=qs',
			//url: QS_PROTOCOL + 'quote.morningstar.com/fund/fundquote.aspx?ops=clear&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'CE Operation': {
			txt: QS_Lang.quicktake["oper"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/cefund/operations.html?ProductCode=QS&ops=clear',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_operation2.png'
		},
		//3.24 Tax Analysis ====================  same as ETF
		//3.15 Shareholders ====================  same as stock
		//3.27 Filings ====================  same as ETF
		//3.29 Overview
		'CEF Overview': {
			txt: QS_Lang.quicktake["over"],
			val: '',
			url: QS_PROTOCOL + 'cef.morningstar.com/quote?productcode=qs&ops=clear',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_overview.png'
		},
		
		//3.31 Distribution
		'Distribution': {
			txt: QS_Lang.quicktake["dist"],
			val: '',
			url: QS_PROTOCOL + 'cef.morningstar.com/distribution?productcode=qs&ops=clear',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_distribution.png'
		},
		
		//3.34 Performance
		'CEF Performance': {
			txt: QS_Lang.quicktake["perf"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/cef/total-returns.action?productcode=qs&ops=clear&culture=en-us&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_performance2.png'
		},
		'CEF Total Returns': {
			txt: QS_Lang.quicktake["total"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/cef/total-returns.action?productcode=qs&ops=clear&culture=en-us&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Price': {
			txt: QS_Lang.quicktake["price"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/cef/performance-price.action?productcode=qs&ops=clear&culture=en-us&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'Country': 'country'
			}]
		},
		
		//3.35 Ratings & Risk
		'CEF Ratings & Risk': {
			txt: QS_Lang.quicktake["r&r"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/funds/cef/ratings-risk.action?productcode=qs&ops=clear&culture=en-US',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_ratingsrisk2.png'
		},
		//3.36 Portfolio
		'Portfolio1': {
			txt: QS_Lang.quicktake["port"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=1',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_portfolio.png'
		},
		'Bond Breakdown': {
			txt: QS_Lang.quicktake["bondbreak"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/cef?productCode=qs&module=4',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/cef?productcode=qs&module=4',
			par: [{
				't': 'TICKER'
			}, {
				'region': 'country'
			}]
		}
	});
})();
(function(){
	$.extend(QS_QT_TabMapping, {
		3.46: QS_QTabs['CEF Quote'],
		3.32: QS_QTabs['CE Operation'],
		3.29: QS_QTabs['CEF Overview'],
		3.31: QS_QTabs['Distribution'],
		3.34: $.extend(QS_QTabs['CEF Performance'], {
			subTab: {
				3.3411: QS_QTabs['CEF Total Returns'],
				3.3412: QS_QTabs['Price']
			}
		}),
		3.35: QS_QTabs['CEF Ratings & Risk'],
		3.36: $.extend(true, QS_QTabs['Portfolio1'], {
			subTab: {
				3.3611: QS_QTabs['Style/Allocation'],
				3.3612: QS_QTabs['Sectors/Stats'],
				3.3613: QS_QTabs['Regions'],
				3.3614: QS_QTabs['Bond Breakdown'],
				3.3615: QS_QTabs['Holdings']
			}
		})
	})
})();

//3.21,3.23,3.24,3.25,3.26,3.27, 3.33    
//3.2114,3.2115,     3.2511,3.2512,3.2513,3.2514,3.2515,3.2516
(function(){//MF
	$.extend(QS_QTabs, {
		//3.33 MF Operation =========== same as ETF
		'MF Quote':{
			txt:  QS_Lang.quicktake["quote"],
			val: '',
			//url: QS_PROTOCOL + 'etfs.morningstar.com/quote?productcode=qs',
			url: QS_PROTOCOL + 'quote.morningstar.com/fund/fundquote.aspx?ops=clear&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'MF Operation': {
			txt:  QS_Lang.quicktake["oper"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/operations.html?productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_operation.png'
		},
		
		//3.23 Ratings & Risk  =========== same as ETF
		//3.25 Portfolio =========== same as ETF
		//3.24 Tax Analysis =========== same as ETF
		//3.21 Performance =========== same as stock
		'Fund Total Returns': {
			txt:  QS_Lang.quicktake["total"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?culture=en-US&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'Investor Returns': {
			txt: QS_Lang.quicktake["investor"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?p=investor_returns_page&culture=en-US&productcode=qs&ops=clear&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		}
		//3.27 Filings  =========== same as ETF
	});
})();
(function(){
	
	
	$.extend(QS_QT_TabMapping[3.21]["subTab"], {
		3.2114: QS_QTabs['Fund Total Returns'],
		3.2115: QS_QTabs['Investor Returns']
	});
	$.extend(QS_QT_TabMapping, {
		3.47: QS_QTabs['MF Quote'],
		3.33: QS_QTabs['MF Operation']
	});
})();

//market money fund
(function(){
	$.extend(QS_QTabs, {
		'FM Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/mm/quote?culture=en-US&productcode=qs&cur=usd',
			par: [{
				't': 'secId'
			}, {
				'region': 'country'
			}]
		},
		
		'FM Operation':{
			txt: QS_Lang.quicktake["oper"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/operations.html?culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Overview':{
			txt: QS_Lang.quicktake["over"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/operations.html?culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Fees & Expenses':{
			txt: QS_Lang.quicktake["f&e"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/expense.html?culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Management':{
			txt: QS_Lang.quicktake["mang"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/management.html?culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Purchase':{
			txt: QS_Lang.quicktake["purch"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/purchase-info.html?culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'FM Portfolio':{
			txt: QS_Lang.quicktake["port"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?module=1&ops=clear&culture=en-us&cur=usd&AAView=usa&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Style & Allocation':{
			txt: QS_Lang.quicktake["s&a"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?module=1&ops=clear&culture=en-us&cur=usd&AAView=usa&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Sectors & Stats':{
			txt: QS_Lang.quicktake["s&s"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?module=2&ops=clear&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM GICS Sector & Industry':{
			txt: QS_Lang.quicktake["s&i"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?module=3&ops=clear&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Regions':{
			txt: QS_Lang.quicktake["reg"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?module=2&ops=clear&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Holdings':{
			txt: QS_Lang.quicktake["holds"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?ops=clear&viewType=ALL&curPage=0&startPage=0&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM History':{
			txt: QS_Lang.quicktake["hist"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/history?ops=clear&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'FM Distributions':{
			txt: QS_Lang.quicktake["dist"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/mm/distribution?ops=clear&culture=en-us&cur=usd&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'FM Performance':{
			txt: QS_Lang.quicktake["perf"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?ops=clear&nav=no&culture=en-us&cur=usd&ep=false&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Total Returns':{
			txt: QS_Lang.quicktake["total"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?ops=clear&nav=no&culture=en-us&cur=usd&ep=false&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Investor Returns':{
			//performance.morningstar.com/fund/performance-return.action?ops=clear&nav=no&p=investor_returns_page&t=vmmxx&region=usa&culture=en-us&cur=usd&ep=false&productcode=qs
			txt: QS_Lang.quicktake["investor"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?ops=clear&nav=no&p=investor_returns_page&culture=en-us&cur=usd&ep=false&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Ratings & Risk':{
			txt: QS_Lang.quicktake["r&r"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/ratings-risk.action?ops=clear&nav=no&culture=en-us&cur=usd&ep=false&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'FM Tax Analysis':{
			txt: QS_Lang.quicktake["taxa"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/tax-analysis.action?ops=clear&nav=no&culture=en-us&cur=usd&ep=false&s=&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		}
	});
})();
(function(){
	$.extend(QS_QT_TabMapping, {
		3.38: QS_QTabs['FM Quote'],
		3.39: $.extend(true, QS_QTabs['FM Operation'], {
			subTab: {
				3.3911: QS_QTabs['FM Overview'],
				3.3912: QS_QTabs['FM Fees & Expenses'],
				3.3913: QS_QTabs['FM Management'],
				3.3914: QS_QTabs['FM Purchase']
			}
		}),
		3.41: $.extend(true, QS_QTabs['FM Portfolio'], {
			subTab: {
				3.4111: QS_QTabs['FM Style & Allocation'],
				3.4112: QS_QTabs['FM Sectors & Stats'],
				3.4113: QS_QTabs['FM GICS Sector & Industry'],
				3.4114: QS_QTabs['FM Regions'],
				3.4115: QS_QTabs['FM Holdings'],
				3.4116: QS_QTabs['FM History']
			}
		}),
		3.42: QS_QTabs['FM Distributions'],
		3.43:  $.extend(true, QS_QTabs['FM Performance'], {
			subTab: {
				3.4311: QS_QTabs['FM Total Returns'],
				3.4312: QS_QTabs['FM Investor Returns'],
				3.4313: QS_QTabs['FM Ratings & Risk'],
				3.4314: QS_QTabs['FM Tax Analysis']
			}
		})
	});	
})();


//Preferred Stock 
(function(){
	
});
(function(){
	
});

(function(){//API
	$.extend(QS_QTabs, {
		'QUEST Stock Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: getQtPageUrl + '43&path=' + QS_PROTOCOL + 'quote.morningstar.com/stock/stockquote.aspx?ops=clear&cur=usd&ProductCode=QS&culture=en-US',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'QUEST ETF Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: getQtPageUrl + '42&path=' + QS_PROTOCOL + 'etfs.morningstar.com/quote?productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}, {
				'tickerName': 'Name'
			}, {
				'rating': 'rr01y'
			}],
			statc: true,
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_profile.png'
		},
		
		'CorporateActions Dividends': {
			txt: QS_Lang.quicktake["divid"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=dividend_split_page&culture=en-US&productcode=qs&ops=clear&subPage=1&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		'CorporateActions Splits': {
			txt: QS_Lang.quicktake["split"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/stock/performance-return.action?p=dividend_split_page&culture=en-US&productcode=qs&ops=clear&subPage=2&nav=no',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}]
		},
		
		'OffShoreFunds Quote': {
			txt: QS_Lang.quicktake["quote"],
			val: '',
			url: QS_PROTOCOL + 'quote.morningstar.com/fund/fundquote.aspx?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Chart': {
			txt: QS_Lang.quicktake["chart"],
			val: '',
			url: QS_PROTOCOL + 'quote.morningstar.com/fund/chartquote.aspx?ops=clear&productcode=QS&culture=en-US&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Performance': {
			txt: QS_Lang.quicktake["perf"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/performance-return.action?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Ratings&Risk': {
			txt: QS_Lang.quicktake["r&r"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/ratings-risk.action?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Management': {
			txt: QS_Lang.quicktake["mang"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/management.html?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Portfolio': {
			txt: QS_Lang.quicktake["port"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Expense': {
			txt: QS_Lang.quicktake["expense"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/expense.html?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Tax': {
			txt: QS_Lang.quicktake["tax"],
			val: '',
			url: QS_PROTOCOL + 'performance.morningstar.com/fund/tax-analysis.action?ops=clear&productcode=qs&t=LU0381785046&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Purchase': {
			txt: QS_Lang.quicktake["purch"],
			val: '',
			url: QS_PROTOCOL + 'financials.morningstar.com/fund/purchase-info.html?ops=clear&productcode=qs&t=LU0381785046&region=LUX&culture=en-US',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Filings': {
			txt: QS_Lang.quicktake["filings"],
			val: '',
			url: QS_PROTOCOL + 'doc.morningstar.com/DocHistory.aspx?clientid=dotcom&key=9bc0dc0ff19106fc&display=DUGCX&secId=F000002KFS&region=LUX',
			par: [],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		},
		'OffShoreFunds Style/Allocation': {
			txt: QS_Lang.quicktake["s/a"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=1',
			url: QS_PROTOCOL + 'research.morningstar.com/fund/cef?productCode=qs&module=1&aaview=UK&t=LU0381785046&region=LUX',
			par: []
		},
		'OffShoreFunds Sectors/Stats': {
			txt: QS_Lang.quicktake["s/s"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=2',
			url: QS_PROTOCOL + 'research.morningstar.com/fund/cef?productCode=qs&module=2&t=LU0381785046&region=LUX',
			par: []
		},
		'OffShoreFunds GICS Sector/Industry': {
			txt: QS_Lang.quicktake["s/i"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/summary?productCode=qs&module=3&t=LU0381785046&region=LUX',
			par: []
		},
		'OffShoreFunds Holdings': {
			txt: QS_Lang.quicktake["holds"],
			val: '',
			//url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?productCode=qs',
			url: QS_PROTOCOL + 'research.morningstar.com/fund/holdings?productCode=qs&t=LU0381785046&region=LUX',
			par: []
		},
		'OffShoreFunds Regions': {
			txt: QS_Lang.quicktake["reg"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/details?productCode=qs&module=2&t=LU0381785046&region=LUX',
			par: []
		},
		'OffShoreFunds History': {
			txt: QS_Lang.quicktake["hist"],
			val: '',
			url: QS_PROTOCOL + 'portfolios.morningstar.com/fund/history?productCode=qs&t=LU0381785046&region=LUX',
			par: []
		},
		'Company Overview': {
			txt: QS_Lang.quicktake["cover"],
			val: '',
			url: QS_PROTOCOL + 'quote.morningstar.com/stock/stockquote.aspx?ops=clear&culture=en-us&productcode=qs',
			par: [{
				't': 'ticker'
			}, {
				'region': 'country'
			}],
			value: 'qt',
			imgPosition: '0 0',
			imgSrc: 'bg_pre_qt_transcript.png'
		}
	});
})();



QtLoaderConfigToolKit = function(){
	this.theme = {
		"default":{
			"permision":['3.11', '3.26', '3.14','3.1411','3.1412', '3.15','3.1511','3.1512','3.1513','3.1514','3.1515','3.16','3.1611','3.1612','3.1613','3.1614','3.1615','3.1616','3.1617','3.1618','3.1619'],
			"files":['theme/quicktake/style.css']
		},
		
		"black":{
			"permision":['3.11', '3.26', '3.14','3.1411','3.1412', '3.15','3.1511','3.1512','3.1513','3.1514','3.1515','3.16','3.1611','3.1612','3.1613','3.1614','3.1615','3.1616','3.1617','3.1618','3.1619'],
			"files":['theme/quicktake/style.css']
		},
		
		"grey":{
			"permision":['3.11', '3.26', '3.14','3.1411','3.1412', '3.15','3.1511','3.1512','3.1513','3.1514','3.1515','3.16','3.1611','3.1612','3.1613','3.1614','3.1615','3.1616','3.1617','3.1618','3.1619'],
			"files":['theme/quicktake/style.css']
		},
		
		'custom':{
			"permision":['3.11', '3.26', '3.14','3.1411','3.1412', '3.15','3.1511','3.1512','3.1513','3.1514','3.1515','3.16','3.1611','3.1612','3.1613','3.1614','3.1615','3.1616','3.1617','3.1618','3.1619','3.2511','3.2512','3.2513','3.2514','3.2515','3.2516','3.28','3.42'],
			"files":[]
		}
	},
	
	this.defautFileList = [],
	
	
	this.client={
		"default":{//termianl
			"common":['theme/default/style.css'],
			"module":{
				"3.44":['apis/quicktake/quicktake_quote.js'],
				"3.45":['apis/quicktake/quote_etf.js'],
				"3.46":['apis/quicktake/quote_pcm.js'],
				"3.47":['apis/quicktake/quote_mf.js']
			}
		},
		"quest":{
			"common":['theme/default/style.css','apis/quicktake/quicktake_width.css','apis/quicktake/version_quest.js','apis/quicktake/set_width.js'],
			"module":{}
		},
		"mlwm":{
			"common":['apis/quicktake/version_mlwm.js'],
			"module":{
				"3.11":[]
			}
		},
		"qtrade":{
			"common":['apis/quicktake/version_qtrade.js'],
			"module":{
				"3.11":[]
			}
		},
		"qstpub":{
			"common":['theme/default/style.css','apis/quicktake/quicktake_width.css','apis/quicktake/version_quest.js','apis/quicktake/set_width.js'],
			"module":{
				"3.11":["apis/quicktake/quicktake3.11.js"]
			}
		},
		"mssb":{
			"common":['apis/quicktake/version_quest.js'],
			"module":{
				"3.11":[]
			}
		}
	},
	
	this.module = {
		'3.11': {
			"name": 'profile',
			"files": ['apis/quicktake/profile_stock.js']
		},
		
		'3.1211': ['apis/quicktake/analysis-current.js'],//stock analysis current
		
		'3.14': {
			"name": 'valuation',
			"files": []
		},
		'3.1411': {
			"name": 'valuation',
			"files": []
		},
		'3.1412':{
			"name":  'wallStreetEst',
			"files": []
		},
		'3.15': {
			"name": 'shareholders',
			"files": []
		},
		'3.1511': {
			"name": 'shareholders overview',
			"files": []
		},
		'3.1512': {
			"name": 'shareholders major',
			"files": []
		},
		'3.1513': {
			"name": 'shareholders concentrated',
			"files": []
		},
		'3.1514': {
			"name": 'shareholders buying',
			"files": []
		},
		'3.1515': {
			"name": 'shareholders selling',
			"files": []
		},
		'3.16': {
			"name": 'insiders',
			"files": []
		},
		'3.1611': {
			"name": 'insiders overview',
			"files": []
		},
		'3.1612': {
			"name": 'insiders exec',
			"files": []
		},
		'3.1613': {
			"name": 'insiders activity',
			"files": []
		},
		'3.1614': {
			"name": 'insiders key',
			"files": []
		},
		'3.1615': {
			"name": 'insiders board',
			"files": []
		},
		'3.1616': {
			"name": 'insiders comm',
			"files": []
		},
		'3.1617': {
			"name": 'insiders itrans',
			"files": []
		},
		'3.1618': {
			"name": 'insiders exec profile',
			"files": []
		},
		'3.1619': {
			"name": 'insiders summary detail',
			"files": []
		},
		
		'3.22':{
			"name": 'industrypeer',
			"files": ['apis/quicktake/industrypeer_stock.js']
		},
		'3.2511': {
			"name": 'portfolio style-allocation',
			"files": []
		},
		'3.2512': {
			"name": 'portfolio sectors-stats',
			"files": []
		},
		'3.2513': {
			"name": 'portfolio gics',
			"files": []
		},
		'3.2514': {
			"name": 'portfolio holdings',
			"files": []
		},
		'3.2515': {
			"name": 'portfolio regions',
			"files": []
		},
		'3.2516': {
			"name": 'portfolio history',
			"files": []
		},
		
		'3.26': {
			"name": 'operation',
			"files": []
		},
		'3.28': {
			"name": 'performance',
			"files": []
		},
		
		'3.44': {
			"name": 'quote',
			"files": ['css/qt/for_quote.css','apis/quicktake/quicktake_quote.js']
		},
		'3.45': {
			"name": 'quote',
			"files": ['apis/quicktake/quote_etf.js']
		},
		
		'3.0111': {
			"files":['apis/quicktake/dividends_stock.js']//mlwm stock dividends
		}
	}
}

QtLoaderConfigToolKit.prototype = {
	/**
	 * @param {Object} {client,theme,module}	
	 * @return {Object} {client,theme,module,name,files}
	 */
	getConfig:function(obj){
		var profile = obj;
		
		var client = obj.client||'default';
		var theme = obj.client||'default';
		var module = obj.module||'default';
		
		//theme configuration
		var files = [], name = null;
		if(this.theme[theme]){
			var themeProfile = this.theme[theme];
			if($.inArray(module,themeProfile["permision"]) >= 0){//add theme css/js acording to "module permision" ^__^
				files = files.concat(themeProfile["files"]);
			}
		}
		
		//client configuration
		if(this.client[client]){
			var clientProfile = this.client[client];
			files = files.concat(clientProfile["common"]);//add client common css/js
			if(clientProfile["module"] && clientProfile["module"][module]){//add client module css/js
				files = files.concat(clientProfile["module"][module]);
			}
		}
		
		//module configuration
		if (this.module[module]) {
			var moduleProfile = this.module[module];
			if(moduleProfile["name"]){
				name = moduleProfile["name"];
			}
			if(moduleProfile["files"]){
				files = files.concat(moduleProfile["files"]);
			}
		}
		
		//sort css/js
		files = files.sort(function(a, b){
				if (a.indexOf(".css") != -1 && b.indexOf(".js") != -1) {
					return -1;
				}
				else 
					if (a.indexOf(".js") != -1 && b.indexOf(".css") != -1) {
						return 1;
					}
					else {
						return 0;
					}
			});
			
		name ? profile.name = name : null;
		profile.files = files;
		return profile;
	}
}

var QTLOADER_CONFIGTOOLKIT = new QtLoaderConfigToolKit();
